package org.csu.mypetstore.persistence;

import org.apache.ibatis.annotations.Param;
import org.csu.mypetstore.domain.Account;
import org.csu.mypetstore.domain.Cart;
import org.csu.mypetstore.domain.CartItem;
import org.csu.mypetstore.domain.Item;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Repository
public interface CartMapper {

    void updateCart(@Param("account") Account account,@Param("cartItem")CartItem cartItem,@Param("quantity") int quantity,@Param("total") BigDecimal total) ;

    List<CartItem> getCartByUsername(String username);

    void removeByUsernameAndItemId(@Param("account")Account account, @Param("itemId")String itemId);

    void removeByUsername(Account account);

    void ChangeItemQuantity(String itemId,String username,String quantity,String total);

    List<CartItem> getQuantityAndTotalByUsername(String username);
}